<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Models\Post;
use Illuminate\Http\Request;

class PostController extends  Controller
{
    //
    public function index()
    {
        $post = new Post();
        // 分页
        $data = $post->with("User")->orderBy("id", "desc")->paginate(10);
        return  $data;
    }
}
